package com.hzjiteng.newsbymvp.main.presenter;

import android.view.MenuItem;

import com.hzjiteng.newsbymvp.R;
import com.hzjiteng.newsbymvp.main.view.MainView;

/**
 * @author Administrator
 * @created_time 2016072713:50
 */
public class MainPresenterImpl implements MainPresenter {

    private MainView mainView;

    public MainPresenterImpl(MainView mainView) {
        this.mainView = mainView;
    }

    @Override
    public void menuSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.menu_news:
                mainView.switchNews();
                break;
            case R.id.menu_images:
                mainView.switchIamges();
                break;
            case R.id.menu_weather:
                mainView.switchWeather();
                break;
            case R.id.menu_about:
                mainView.switchAbout();
                break;
        }
    }
}
